package com.lc.app.myaccount.entity;

/**
 * Created by LC on 2/5/2016.
 * 保存用户信息，
 * 名字，密码。 isAdmin = 1 代表admin 不能删除
 */
public class UserEntity {
    private int _id;
    private String name;
    private String password;
    private int isAdmin;

    public UserEntity() {
    }

    public UserEntity(int _id, String name, String password) {
        this._id = _id;
        this.name = name;
        this.password = password;
        this.isAdmin = 0;
    }

    public int get_id() {
        return _id;
    }

    public void set_id(int _id) {
        this._id = _id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getIsAdmin() {
        return isAdmin;
    }

    public void setIsAdmin(int isAdmin) {
        this.isAdmin = isAdmin;
    }

    @Override
    public String toString() {
        return "UserEntity{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", isAdmin=" + isAdmin +
                '}';
    }

    public Object[] toAddArray(){
        return new Object[]{this.getName(),this,getPassword(),this.getIsAdmin()};
    }

    public Object[] toUpdateArray(){
        return new Object[]{this.getName(),this,getPassword(),this.getIsAdmin(),this.get_id()};
    }

}
